package com.project.service;

import com.project.common.utils.MyPageHelper;
import com.project.dao.ComposePaperMapper;
import com.project.entity.ComposePaper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Transactional(rollbackFor = {Exception.class})
@Service
public class ComposePaperServiceImpl implements ComposePaperService{

    @Autowired
    ComposePaperMapper composePaperMapper;

    @Override
    public int add(ComposePaper composePaper)
    {
        return composePaperMapper.insertSelective(composePaper);
    }

    @Override
    public List<ComposePaper> findByPaperId(Integer paperid) { return composePaperMapper.selectByPaperId(paperid);}

    @Override
    public List<ComposePaper> findByPaperIdAndExerinfoid(Integer paperid, Integer exerinfoid) { return composePaperMapper.selectByPaperIdAndExerinfoid(paperid,exerinfoid);}

    @Override
    public void remove(Integer paperid, Integer exerinfoid) { composePaperMapper.deleteByPaperIdAndExerinfoId(paperid,exerinfoid); }

}
